#ifndef BUTTONRELAY_H
#define BUTTONRELAY_H

#include <QPushButton>
#include "relay.h"

class ButtonRelay : public QPushButton
{
public:
    ButtonRelay();
    ButtonRelay(QString& name, int bid, int rid, int status, bool isCurrent);

    virtual QSize sizeHint() const;

    void setStatus(int status);
    int status();

    void setCurrent(int current);

    enum {
        DefWidth=100,DefHeight=100
    };

protected:
    virtual void paintEvent(QPaintEvent *e);

private:
    QPixmap mPixmapBackground;
    QPixmap mPixmapStatus;

    QString mName;
    int mBId;
    int mRId;
    int mStatus;
    bool mIsCurrent;
    int mCurrent;

    QPixmap mPixmapOn;
    QPixmap mPixmapOff;
    QPixmap mPixmapReady;
    QPixmap mPixmapPending;
    QPixmap mPixmapUnknown;

};

#endif // BUTTONRELAY_H
